home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2007 December / PCWKCD1207B.iso / Blogowanie poza sfera / Flock 0.9.1.3 stable / flock-0.9.1.3.en-US.win32.exe / flock / chrome / browser.jar / content / browser / sanitize.xul < prev    next >
Extensible Markup Language  |  2007-08-02  |  8KB  |  179 lines

  1. <?xml version="1.0"?>
  2.  
  3.  
  4. <?xml-stylesheet href="chrome://global/skin/"?>
  5.  
  6. <!DOCTYPE prefwindow [
  7.   <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
  8.   <!ENTITY % sanitizeDTD SYSTEM "chrome://browser/locale/sanitize.dtd">
  9.   <!ENTITY % flockSanitizeDTD SYSTEM "chrome://flock/locale/browser/sanitize.dtd">
  10.   %brandDTD;
  11.   %sanitizeDTD;
  12.   %flockSanitizeDTD;
  13. ]>
  14.  
  15. <prefwindow id="SanitizeDialog" type="child"
  16.             xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  17.             dlgbuttons="accept,cancel"
  18.             title="&sanitizeDialog.title;"
  19.             style="width: 30em !important;"
  20.             ondialogaccept="gSanitizePromptDialog.sanitize();">
  21.  
  22.   <prefpane id="SanitizeDialogPane" onpaneload="gSanitizePromptDialog.init();">
  23.     <stringbundle id="bundleBrowser" src="chrome://browser/locale/browser.properties"/>
  24.     
  25.     <script type="application/x-javascript" src="chrome://browser/content/sanitize.js"/>
  26.     <script type="application/x-javascript">
  27.     <![CDATA[
  28.       var gSanitizePromptDialog = {
  29.         init: function ()
  30.         {
  31.           var s = new Sanitizer();
  32.           var sanitizePreferences = document.getElementById("sanitizePreferences");
  33.           for (var i = 0; i < sanitizePreferences.childNodes.length; ++i) {
  34.             var preference = sanitizePreferences.childNodes[i];
  35.             var name = s.getNameFromPreference(preference.name);
  36.             if (!s.canClearItem(name)) 
  37.               preference.disabled = true;
  38.           }
  39.           
  40.           var bundleBrowser = document.getElementById("bundleBrowser");
  41.           document.documentElement.getButton("accept").label = bundleBrowser.getString("sanitizeButton");
  42.  
  43.           var picfgacct = document.getElementById("privacy.item.configuredAccounts.checkbox");
  44.           var pipasswd = document.getElementById("privacy.item.passwords.checkbox");
  45.           if ( pipasswd.checked && !picfgacct.disabled ) {
  46.             picfgacct.disabled = true;
  47.             picfgacct.checked = true;
  48.           }
  49.         },
  50.       
  51.         sanitize: function ()
  52.         {
  53.           var s = new Sanitizer();
  54.           var sanitizePreferences = document.getElementById("sanitizePreferences");
  55.           var prefcfgacct = document.getElementById("privacy.item.configuredAccounts");
  56.           var picfgacct = document.getElementById("privacy.item.configuredAccounts.checkbox");
  57.           var preference, name;
  58.           // Ensure we pick up our programatically changed value.
  59.           if ( picfgacct.checked ) {
  60.             prefcfgacct.value = true;
  61.           } else {
  62.             prefcfgacct.value = false;
  63.           }
  64.           for (var i = 0; i < sanitizePreferences.childNodes.length; ++i) {
  65.             preference = sanitizePreferences.childNodes[i];
  66.             if (preference.value) {
  67.               name = s.getNameFromPreference(preference.name);
  68.               try {
  69.                 s.clearItem(name);
  70.               } catch(er) {
  71.                 dump(er + " sanitizing " + name); 
  72.                 // TODO: give user feedback about partially failed sanitization
  73.               }
  74.             }
  75.           }
  76.         },
  77.         
  78.         onReadGeneric: function ()
  79.         {
  80.           var preferences = document.getElementById("sanitizePreferences");
  81.           var found = false;
  82.           for (var i = 0; i < preferences.childNodes.length; ++i) {
  83.             var preference = preferences.childNodes[i];
  84.             if (preference.value && !preference.disabled) {
  85.               found = true;
  86.               break;
  87.             }
  88.           }
  89.           try {
  90.             document.documentElement.getButton("accept").disabled = !found;
  91.           }
  92.           catch (e) { }
  93.           return undefined;
  94.         },
  95.         
  96.         onClickPassword: function ()
  97.         {
  98.           var prefcfgacct = document.getElementById("privacy.item.configuredAccounts");
  99.           var picfgacct = document.getElementById("privacy.item.configuredAccounts.checkbox");
  100.           var pipasswd = document.getElementById("privacy.item.passwords.checkbox");
  101.           // HACK ALERT:
  102.           //    if "Passwords" is CHECKED, we want to DISABLE the configuredAccounts checkbox.
  103.           //    The following if statement looks reversed, but it is not: the onclick handler
  104.           //    is called BEFORE the state of the checkbox changes, so the if statement is
  105.           //    actually testing the PRIOR state.
  106.           if ( !pipasswd.checked ) {
  107.             picfgacct.disabled = true;
  108.             picfgacct.checked = true;
  109.           } else {
  110.             picfgacct.disabled = false;
  111.             picfgacct.checked = prefcfgacct.value;
  112.           }
  113.           return undefined;
  114.         }
  115.       };
  116.     ]]>
  117.     </script>
  118.  
  119.     <preferences id="sanitizePreferences">
  120.       <preference id="privacy.item.history"               name="privacy.item.history"               type="bool" readonly="true"/>
  121.       <preference id="privacy.item.formdata"              name="privacy.item.formdata"              type="bool" readonly="true"/>
  122.       <preference id="privacy.item.downloads"             name="privacy.item.downloads"             type="bool" readonly="true"/>
  123.       <preference id="privacy.item.cookies"               name="privacy.item.cookies"               type="bool" readonly="true"/>
  124.       <preference id="privacy.item.cache"                 name="privacy.item.cache"                 type="bool" readonly="true"/>
  125.       <preference id="privacy.item.sessions"              name="privacy.item.sessions"              type="bool" readonly="true"/>
  126.       <!-- pref handles deletion of accounts data in RDF -->
  127.       <preference id="privacy.item.configuredAccounts"    name="privacy.item.configuredAccounts"    type="bool" readonly="true"/>
  128.       <preference id="privacy.item.passwords"             name="privacy.item.passwords"             type="bool" readonly="true"/>
  129.     </preferences>
  130.  
  131.     <description>&sanitizeItems.label;</description>
  132.  
  133.     <checkbox label="&itemHistory.label;"
  134.               accesskey="&itemHistory.accesskey;"
  135.               preference="privacy.item.history"
  136.               tooltiptext="&itemHistory.tooltip;"
  137.               onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
  138.     <checkbox label="&itemDownloads.label;"
  139.               accesskey="&itemDownloads.accesskey;"
  140.               preference="privacy.item.downloads"
  141.               tooltiptext="&itemDownloads.tooltip;"
  142.               onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
  143.     <checkbox label="&itemFormSearchHistory.label;"
  144.               accesskey="&itemFormSearchHistory.accesskey;"
  145.               preference="privacy.item.formdata"
  146.               tooltiptext="&itemFormSearchHistory.tooltip;"
  147.               onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
  148.     <checkbox label="&itemCache.label;"
  149.               accesskey="&itemCache.accesskey;"
  150.               preference="privacy.item.cache"
  151.               tooltiptext="&itemCache.tooltip;"
  152.               onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
  153.     <checkbox label="&itemCookies.label;"
  154.               accesskey="&itemCookies.accesskey;"
  155.               preference="privacy.item.cookies"
  156.               tooltiptext="&itemCookies.tooltip;"
  157.               onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
  158.     <checkbox label="&itemSessions.label;"
  159.               accesskey="&itemSessions.accesskey;"
  160.               preference="privacy.item.sessions"
  161.               tooltiptext="&itemSessions.tooltip;"
  162.               onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
  163.     <checkbox label="&itemPasswords.label;"
  164.               id="privacy.item.passwords.checkbox"
  165.               accesskey="&itemPasswords.accesskey;"
  166.               preference="privacy.item.passwords"
  167.               tooltiptext="&itemPasswords.tooltip;"
  168.               onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"
  169.               onclick="return gSanitizePromptDialog.onClickPassword();"/>
  170.     <!-- handles deletion of accounts data in RDF -->
  171.     <checkbox label="&allAccounts.label;"
  172.               id="privacy.item.configuredAccounts.checkbox"
  173.               preference="privacy.item.configuredAccounts"
  174.               tooltiptext="&allAccounts.tooltip;"
  175.               onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
  176.  
  177.   </prefpane>
  178. </prefwindow>
  179.